/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package csm.uttils.generics;

/**
 *
 * @author Gaston Quiroga
 */
public abstract class Sorter
{
    private static treeAVL av;

    public static void loadTree(hashChart th)
    {
         av=new treeAVL();
         for(int i=0;i<th.toArray().length;i++)
        {
            av.add((Comparable) (th.toArray()[i]));
        }
    }
    public static Object[] sortAsc(hashChart th)
    {
        loadTree(th);
        return av.toEntreOrdenAsc();
    }
    public static Object[] sortDesc(hashChart th)
    {
        loadTree(th);
        return av.toEntreOrdenDesc();
    }
    public static Object getHigher(hashChart th)
    {
        loadTree(th);
        return av.Mayor();
    }
    public static Object getLower(hashChart th)
    {
        loadTree(th);
        return av.Menor();
    }

}
